<template>
  <div class="bridge-waiting">
    <div class="center">
      <img class="img" src="@tapui/imgs/loading.gif" alt="" />
    </div>
  </div>
</template>
<script>
import { getAction, postAction } from '@tapui/utils/http'
export default {
  data() {
    return {
      loading: true,
      verifyUrl: '/auth/loginBySecurity'
    }
  },
  created() {
    if (this.$store.getters.user.code === this.$route.query.username) {
      this.$router.push({ path: this.$route.query.url || '/' })
      return
    }
    this.$store.dispatch('LogOut').then((r) => {
      this.$store.dispatch('Token', this.$route.query.token).then(res => {
        this.$router.push({ path: this.$route.query.url || '/' })
      })
    })
    //  if (this.$route.query.url.indexOf('?') > -1) {
    //       let path = this.$route.query.url.split('?')[0]
    //       let param = this.$route.query.url.split('?')[1]
    //       let paramarray = param.split('&')
    //       let queryParam = {}
    //       paramarray.forEach(element => {
    //         let key = element.split('=')[0]
    //         let value = element.split('=')[1]
    //         queryParam[key] = value
    //       })
    //       // this.$router.push({ path: this.$route.query.url.split('?')[0], query: queryParam })
    //       this.$router.push({ name: '1011', params: queryParam })
  }
}
</script>
<style scoped lang="scss" rel="stylesheet/scss">
.bridge-waiting {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  background: white;
  overflow: hidden;
  .center {
    position: absolute;
    width: 100%;
    text-align: center;
    top: 50%;
    margin-top: -250px;
  }
}
</style>
